import ctypes
from ctypes import wintypes

def get_appdata_directory():
    CSIDL_APPDATA = 0x001a

    dll = ctypes.windll.shell32
    app_data_directory = ctypes.create_unicode_buffer(wintypes.MAX_PATH)

    found = dll.SHGetFolderPathW(0, CSIDL_APPDATA, 0, 0, app_data_directory)

    path = app_data_directory.value.split('\\')

    if path[-1] == 'Roaming':
        app = app_data_directory.value.replace('Roaming', 'Local')
        return app + '\\siFi3\\'
    else:
        return app_data_directory.value + '\\siFi3\\'

#appdata = get_appdata_directory()
#print(appdata)